import three;
size(200);
currentprojection=perspective(615,-368,-233);
triple[][] pts = {{
    (0.5, 0, -0.5),
    (0, 0, -0.5),
    (0, 1, -0.5),
    (0.5,1, -0.5),
    (1, 1, -0.5),
    (1, 0, -0.5),
    (0.5, 0, -0.5)
  },{
    (0.5, 0, 0.7),
    (0, 0, 0.7),
    (0, 1, 0.7),
    (0.5, 1, 0.7),
    (1, 1, 0.7),
    (1, 0, 0.7),
    (0.5, 0, 0.7)
  }, {
    (0.5, 0, 0.9),
    (0, 0, 0.9),
    (0, 1, 1.5),
    (0.5, 1, 1.5),
    (1, 1, 1.5),
    (1, 0, 0.9),
    (0.5, 0, 0.9)
  }, {
    (0.5, -0.1, 1),
    (0, -0.1, 1),
    (0, 0.5, 2),
    (0.5, 0.5, 2),
    (1, 0.5, 2),
    (1, -0.1, 1),
    (0.5, -0.1, 1)
  }, {
    (0.5, -0.3, 1),
    (0, -0.3, 1),
    (0, -0.3, 2),
    (0.5, -0.3, 2),
    (1, -0.3, 2),
    (1, -0.3, 1),
    (0.5, -0.3, 1)
  }, {
    (0.5, -1.5, 1),
    (0, -1.5, 1),
    (0, -1.5, 2),
    (0.5, -1.5, 2),
    (1, -1.5, 2),
    (1, -1.5, 1),
    (0.5, -1.5, 1)
  }
};
real[] uknot = {0, 0, 0, 1/4, 1/2, 3/4, 1, 1, 1};
real[] vknot = {0, 0, 0, 1/4, 1/2, 1/2, 3/4, 1, 1, 1};
real[][] weights={
  {1, .5, .5, 1, .5, .5, 1},
  {1, .5, .5, 1, .5, .5, 1},
  {1, .5, .5, 1, .5, .5, 1},
  {1, .5, .5, 1, .5, .5, 1},
  {1, .5, .5, 1, .5, .5, 1},
  {1, .5, .5, 1, .5, .5, 1}
};
draw(pts,uknot,vknot,weights,yellow);
